package com.ddyx.rest;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ddyx.service.ITimeLineService;

@Controller
@RequestMapping("/timeLine")
public class TimeLineController {

	@Resource
	ITimeLineService timeLineService;
	
	@RequestMapping("/selectTimeLine")
	@ResponseBody
	public Map<String, Object> selectTimeLine(int page,int size,String contactId){
		Map<String, Object> map = new HashMap<>();
		List<Map<String, Object>> data = timeLineService.selectTimeLine(page, size, contactId);
		int total = timeLineService.eventLogCount(page, size, contactId);
		if(data!=null) {
			map.put("status", true);
			map.put("page", page);
			map.put("size", size);
			map.put("total", total);
			map.put("data", data);
		}
		return map;
	}
}
